﻿<Page
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:vm="clr-namespace:Jiuyong.ViewModels" 
	xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" 
	xmlns:Jiuyong="clr-namespace:Jiuyong" 
	x:Class="Jiuyong.Views.SuperReplacePage" 
      mc:Ignorable="d" 
	  FontSize="16"
	Title="SuperReplace" d:DesignWidth="520.33" d:DesignHeight="349.353">

	<Page.DataContext>
		<vm:SuperReplaceViewModel/>
	</Page.DataContext>

    <Grid x:Name="LayoutRoot">
    	<Grid Margin="20" Visibility="Hidden">
    		<Grid.ColumnDefinitions>
    			<ColumnDefinition Width="0.33*"/>
    			<ColumnDefinition Width="0.67*"/>
    		</Grid.ColumnDefinitions>
    		<Grid.RowDefinitions>
    			<RowDefinition Height="0.15*"/>
    			<RowDefinition Height="0.157*"/>
    			<RowDefinition Height="0.136*"/>
    			<RowDefinition Height="0.557*"/>
    		</Grid.RowDefinitions>
    		<Label Content="输入路径：" HorizontalAlignment="Center" VerticalAlignment="Center"/>
    		<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Bold" Margin="-0.001,0,0,0"><Hyperlink Command="ApplicationCommands.Open"><Run Text="选择..."/></Hyperlink></TextBlock>
    		<Label Content="输出路径：" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
    		<TextBlock Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Bold"><Hyperlink Command="ApplicationCommands.Open"><Run Text="选择..."/></Hyperlink></TextBlock>
    		<Button Content="开始替换：" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
    		<ProgressBar Height="10" VerticalAlignment="Center" Grid.Row="2" Margin="10,0" Grid.Column="1"/>
    		<TextBlock TextWrapping="Wrap" Text="{Binding ConfigName, Mode=TwoWay, TargetNullValue=（默认）}"/>
        
    	</Grid>

    	<DockPanel>
    	<FlowDocumentReader ScrollViewer.VerticalScrollBarVisibility="Auto" DockPanel.Dock="Top" IsScrollViewEnabled="True" ViewingMode="Scroll" IsTwoPageViewEnabled="False" IsPageViewEnabled="False">
    		<FlowDocument>
    			<Paragraph ><Run Text="　　"/><Run Text=" "/><Hyperlink Command="MediaCommands.Play"><Run FontWeight="Bold" Text="将"/></Hyperlink><Run Text=" "/><Hyperlink Command="ApplicationCommands.Open"><Run Text="文件夹：“"/><Run Text=" "/><Run Text="{Binding InputPath, TargetNullValue=?}"/><Run Text=" "/><Run Text="”"/></Hyperlink><Run Text=" "/><Run Text="中的"/><Run Text=" "/><Hyperlink Command="ApplicationCommands.NotACommand"><Run Text="所有"/></Hyperlink><Run Text=" "/><Run Text="目录、"/><Run Text=" "/><Hyperlink Command="ApplicationCommands.NotACommand"><Run Text="所有"/></Hyperlink><Run Text=" "/><Run Text="文件"/>（但跳过路径中包含“<Hyperlink Command="ApplicationCommands.Properties" CommandParameter="{Binding ElementName=LayoutRoot}"><Run Text="{Binding SkipPath, TargetNullValue=?}"/></Hyperlink>”）<Run Text="、以及文件内容中的"/><Run Text=" "/><Hyperlink Command="ApplicationCommands.New" CommandParameter="{Binding ElementName=LayoutRoot}"><Run Text="字符串：“"/><Run Text=" "/><Run Text="{Binding InputText, TargetNullValue=?}"/><Run Text=" "/><Run Text="”"/></Hyperlink><Run Text=" "/><Run Text="替换为"/><Run Text=" "/><Hyperlink Command="ApplicationCommands.Replace" CommandParameter="{Binding ElementName=LayoutRoot}"><Run Text="字符串：“"/><Run Text=" "/><Run Text="{Binding OutputText, TargetNullValue=?}"/><Run Text=" "/><Run Text="”"/></Hyperlink><Run Text=" "/><Run Text=""/><Run Text=" "/><Hyperlink Command="ApplicationCommands.NotACommand"><Run Text="（包含二进制文件中的）"/></Hyperlink><Run Text=" "/><Run Text="，并且输出到"/><Run Text=" "/><Hyperlink Command="ApplicationCommands.SaveAs"><Run Text="文件夹：“"/><Run Text=" "/><Run Text="{Binding OutputPath, TargetNullValue=?}"/><Run Text=" "/><Run Text="”"/></Hyperlink><Run Text=" "/><Run Text="中。"/></Paragraph>
    			<Paragraph ><Run Text="　　您可以将上面的设置 "/><Hyperlink Command="MediaCommands.Select"  CommandParameter="{Binding ElementName=LayoutRoot}"><Run Text="{Binding ConfigTitle, TargetNullValue=（默认）}"></Run></Hyperlink><Run Text=" "/><Hyperlink Command="ApplicationCommands.Save"><Run Text="保存"/><Run Text=" "/><Run Text="{Binding SaveTime, StringFormat=（在 \{0:yyyy.MM.dd HH:mm:ss\} 最后修改）, TargetNullValue=（尚未）}"/></Hyperlink><Run Text=" 以便下次继续运行，或者现在就立刻 "/><Hyperlink Command="MediaCommands.Play"><Run Text="运行"/></Hyperlink><Run Text="，并查看 "/><Hyperlink><Run Text="结果"/></Hyperlink><Run Text="，或者"/><Hyperlink Command="ApplicationCommands.Delete"><Run Text="清空"/></Hyperlink><Run Text="结果。。"/></Paragraph>
    		</FlowDocument>
    	</FlowDocumentReader>
    		<WrapPanel DockPanel.Dock="Top" Margin="{DynamicResource ItemMarginThickness}" Visibility="Collapsed">
    			<TextBlock TextWrapping="Wrap"><Run Text="　　"/><Run Text=" "/><Hyperlink Command="MediaCommands.Play"><Run FontWeight="Bold" Text="将"/></Hyperlink><Run Text=" "/><Hyperlink Command="ApplicationCommands.Open"><Run Text="文件夹：“"/><Run Text=" "/><Run Text="{Binding InputPath, TargetNullValue=?}"/><Run Text=" "/><Run Text="”"/></Hyperlink><Run Text=" "/><Run Text="中的"/><Run Text=" "/><Hyperlink Command="ApplicationCommands.NotACommand"><Run Text="所有"/></Hyperlink><Run Text=" "/><Run Text="目录、"/><Run Text=" "/><Hyperlink Command="ApplicationCommands.NotACommand"><Run Text="所有"/></Hyperlink><Run Text=" "/><Run Text="文件"/>（但跳过路径中包含“<Hyperlink Command="ApplicationCommands.Find" CommandParameter="{Binding ElementName=LayoutRoot}"><Run Text="{Binding SkipPath, TargetNullValue=?}"/></Hyperlink>”）<Run Text="、以及文件内容中的"/><Run Text=" "/><Hyperlink Command="ApplicationCommands.New" CommandParameter="{Binding ElementName=LayoutRoot}"><Run Text="字符串：“"/><Run Text=" "/><Run Text="{Binding InputText, TargetNullValue=?}"/><Run Text=" "/><Run Text="”"/></Hyperlink><Run Text=" "/><Run Text="替换为"/><Run Text=" "/><Hyperlink Command="ApplicationCommands.Replace" CommandParameter="{Binding ElementName=LayoutRoot}"><Run Text="字符串：“"/><Run Text=" "/><Run Text="{Binding OutputText, TargetNullValue=?}"/><Run Text=" "/><Run Text="”"/></Hyperlink><Run Text=" "/><Run Text=""/><Run Text=" "/><Hyperlink Command="ApplicationCommands.NotACommand"><Run Text="（包含二进制文件中的）"/></Hyperlink><Run Text=" "/><Run Text="，并且输出到"/><Run Text=" "/><Hyperlink Command="ApplicationCommands.SaveAs"><Run Text="文件夹：“"/><Run Text=" "/><Run Text="{Binding OutputPath, TargetNullValue=?}"/><Run Text=" "/><Run Text="”"/></Hyperlink><Run Text=" "/><Run Text="中。"/></TextBlock>
    			<TextBlock TextWrapping="Wrap"><Run Text="　　您可以将上面的设置 "/><Hyperlink Command="ApplicationCommands.Save"><Run Text="保存"/><Run Text=" "/><Run Text="{Binding SaveResult, TargetNullValue=（尚未）}"/></Hyperlink><Run Text=" 以便下次继续运行，或者现在就立刻 "/><Hyperlink Command="MediaCommands.Play"><Run Text="运行"/></Hyperlink><Run Text="，并查看 "/><Hyperlink><Run Text="结果"/></Hyperlink><Run Text="，或者"/><Hyperlink Command="ApplicationCommands.Delete"><Run Text="清空"/></Hyperlink><Run Text="结果。。"/></TextBlock>
    		</WrapPanel>
    		<Grid>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="*"/>
    				<ColumnDefinition Width="*"/>
    			</Grid.ColumnDefinitions>
    			<ListBox ItemsSource="{Binding OutputLines}" Margin="{DynamicResource ItemMarginThickness}" BorderThickness="0" SelectedItem="{Binding SelectFile, Mode=OneWayToSource}" Background="{x:Null}"/>
    			<ScrollViewer Grid.Column="1" Margin="{DynamicResource ItemMarginThickness}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" >
    				<TextBlock Text="{Binding FileContent}"/>
    			</ScrollViewer>
    		</Grid>
        
    	</DockPanel>
        
    </Grid>
</Page>
